import ajax from "@/lib/ajax";
import config from "@/config";

const HOST = config.host("/api", "/gateway/task/marathon");

// 获取分组列表
const getGroupList = (param) => {
  return ajax.post(`${HOST}/group/search`, param);
};

// 新增分组
const updateGroup = (param) => {
  return ajax.post(`${HOST}/group/add`, param);
};

// 获取号码列表
const getPlayerList = (param) => {
  return ajax.post(`${HOST}/player/search`, param);
};

// 新增号码
const updatePlayer = (param) => {
  return ajax.post(`${HOST}/player/add`, param);
};

// 获取视频列表
const getVideoTaskList = (param) => {
  return ajax.post(`${HOST}/task/search`, param);
};

// 新增视频
const updateVideoTask = (param) => {
  return ajax.post(`${HOST}/task/add`, param);
};

// 视频详情
const detailVideoTask = (param) => {
  return ajax.post(`${HOST}/task/detail?id=${param.id}`, param);
};

// 视频生成
const clipsVideoTask = (param) => {
  return ajax.post(`${HOST}/task/clips`, param);
};

export {
  getGroupList,
  updateGroup,
  getPlayerList,
  updatePlayer,
  getVideoTaskList,
  updateVideoTask,
  detailVideoTask,
  clipsVideoTask,
};
